/*
 * @Author: zheng yong tao
 * @Date: 2022-01-16 01:35:24
 * @LastEditors: zheng yong tao
 * @LastEditTime: 2022-03-13 23:12:24
 * @Description:
 */
let express = require("express");
const api = require("./api");
let router = express.Router();
/**
 * code : 0 -> sql查询失败;msg -> 错误提示
 *        1 -> 查询成功;data -> 返回数据
 *        2 -> 其他错误;msg -> 错误提示
 */
router.get("/getblogs", (req, res, next) => {
  api.getBlogs(req, res, next);
});
router.get("/getBlogDetail", (req, res, next) => {
  api.getBlogDetail(req, res, next);
});
router.get("/login", (req, res, next) => {
  api.login(req, res, next);
});
router.post("/register", (req, res, next) => {
  api.register(req, res, next);
});
router.get("/getTag", (req, res, next) => {
  api.getTag(req, res, next);
});
router.get("/getType", (req, res, next) => {
  api.getType(req, res, next);
});
router.get("/getFilingList", (req, res, next) => {
  api.getFilingList(req, res, next);
});
router.get("/getArticleView", (req, res, next) => {
  api.getArticleView(req, res, next);
});
router.get("/getTypeView", (req, res, next) => {
  api.getTypeView(req, res, next);
});
router.get("/getDateVisit", (req, res, next) => {
  api.getDateVisit(req, res, next);
});
router.get("/getHourVisit", (req, res, next) => {
  api.getHourVisit(req, res, next);
});
router.get("/getCityVisit", (req, res, next) => {
  api.getCityVisit(req, res, next);
});
router.get("/getDateCityVisit", (req, res, next) => {
  api.getDateCityVisit(req, res, next);
});
router.get("/getComment", (req, res, next) => {
  api.getComment(req, res, next);
});
router.get("/getNeedReadComment", (req, res, next) => {
  api.getNeedReadComment(req, res, next);
});

router.post("/editBlogById", (req, res, next) => {
  api.editBlogById(req, res, next);
});
router.post("/addBlog", (req, res, next) => {
  api.addBlog(req, res, next);
});
router.post("/addTag2Blog", (req, res, next) => {
  api.addTag2Blog(req, res, next);
});
router.post("/deleteTag2Blog", (req, res, next) => {
  api.deleteTag2Blog(req, res, next);
});
router.post("/visitBlog", (req, res, next) => {
  api.visitBlog(req, res, next);
});
router.post("/toTopBlog", (req, res, next) => {
  api.toTopBlog(req, res, next);
});
router.post("/deleteBlog", (req, res, next) => {
  api.deleteBlog(req, res, next);
});
router.post("/addTag", (req, res, next) => {
  api.addTag(req, res, next);
});
router.post("/addType", (req, res, next) => {
  api.addType(req, res, next);
});
router.post("/deleteTag", (req, res, next) => {
  api.deleteTag(req, res, next);
});
router.post("/visit", (req, res, next) => {
  api.visit(req, res, next);
});
router.post("/addComment", (req, res, next) => {
  api.addComment(req, res, next);
});
router.post("/readComment", (req, res, next) => {
  api.readComment(req, res, next);
});
router.post("/readAllComment", (req, res, next) => {
  api.readAllComment(req, res, next);
});

module.exports = router;
